package com.ruoyi.project.mobile;

import com.ruoyi.common.utils.R;
import com.ruoyi.common.utils.RFactory;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.project.system.activitytype.domain.ActivityType;
import com.ruoyi.project.system.activitytype.service.IActivityTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注释
 *
 * @autor LCL
 * @date - 2020/11/19
 */
@RestController
@RequestMapping("/api/QAarea")
public class ApiQAareaController extends BaseController {

    @Autowired
    private IActivityTypeService activityTypeService;

    /**
     * 查询问答列表
     * @param uid
     * @return
     */
    @GetMapping("/qAList")
    public R qAList(@RequestParam String uid) {
        startPage();
        ActivityType activityType = new ActivityType();
        activityType.setIsShow(1);
        return RFactory.generateR(getDataTable(this.activityTypeService.selectATList(activityType
        )));
    }

    /**
     * 根据ID查询问答
     * @param id 问答ID
     * @return
     */
    @GetMapping("/detailsById")
    public R detailsById(@RequestParam String id) {
        return RFactory.generateR(this.activityTypeService.selectATById(id));
    }

}
